import { LoginV } from './LoginV'
import { Signin } from '../axios/api'
export default function Login() {
  function login(name, password) {
    let data = {}
    data.account = name.current.value
    data.password = password.current.value
    Signin(data).then((res) => {
      if (res.data.ret === 200) {
        alert('登录成功')
      } else {
        alert('登录失败')
      }
    })
    return () => {
      console.log("登录中... ... 用户名：", name.current.value, "密码：", password.current.value);
      alert("用户" + name.current.value + "登录成功！");
    }
  }
  return (
    <LoginV login={login} className='loginTitle' />
  )
}